<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="my" uri="/mytags"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>政府资助人员管理</title>
			<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/asserts/bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
	
		<!-- js插件 -->
		<script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
		<script src="${pageContext.request.contextPath}/asserts/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/asserts/bootstrapValidate/css/bootstrapValidator.min.css"/>
 	   <script src="${pageContext.request.contextPath}/asserts/bootstrapValidate/js/bootstrapValidator.min.js"></script>
	 <style type="text/css">
			button{
 				height:30px;
 				padding:2px;
 			}
 			.btn{
 				height:30px;
 				padding:2px;
 			}
 			.panel-body{
 				padding:2px;
 			}
 		    .form-group{
 		    	margin:1px;
 		    	padding:1px;
 		    }
 		    table tr th,table tr td{
 		    	text-align:center;
 		    }
	</style>
	</head>
	<body>
			<!-- 内容展示区 -->
			<div >
					<!-- 导航 -->
					<ol class="breadcrumb">
						<li><i class="fa fa-comment"></i> 政府资助人员管理</li>
					</ol>
					<div >
						<!-- 	内容面板 -->
						<div class="panel panel-default">
							<!-- 控制按钮 -->
							<div class="panel-heading">
									<div class="btn-group">
										<button class="btn btn-primary" data-toggle="modal" data-target="#mymodal"><span class="glyphicon glyphicon-pencil"></span>添加</button>
									<button class="btn btn-success"  data-toggle="modal" data-target="#mymodalimport">
										<span class="glyphicon glyphicon-import"></span>导入excel
									</button>
									<button class="btn btn-info" onclick="downTemplate()">
										<span class="glyphicon glyphicon-export"></span>导出excel模板
									</button>
									<button class="btn btn-danger" onclick="removeAll()">
									<span class="glyphicon glyphicon-remove"></span>批量删除</button>
									</div>
										<form action="${pageContext.request.contextPath}/govsub/list" method="post"  class="form-horizontal" >
							<div class="form-group"  style="margin-top:10px">
									<label class="control-label col-md-2">资助项目：</label>
									<div class="col-md-3">
										 		<input type="text" name="subname" value="${subname}" id="selectName"
										placeholder="输入资助项目" class="form-control" />
							
									</div>
								    <%-- <label class="control-label col-md-2">所在学校：</label>
										<div class="col-md-3">
											 <select name="schid" class="form-control">
												<option value="">请选择</option>
											 	<c:forEach var="school" items="${schoolList}">
											 		<option value="${school.schid}" <c:if test="${school.schid==schid}">selected="selected"</c:if>>${school.name}(${school.level})</option>
											 		
											 	</c:forEach>
												</select> 
										</div> --%>
							</div>
							<div class="form-group" >
								<label class="control-label  col-md-2">学生姓名：</label>
								<div class="col-md-3">
									<input type="text" name="name" value="${name}" id="selectName"
										placeholder="输入学生姓名" class="form-control" />
								</div>
								<label class="control-label  col-md-2">身份证号：</label>
								<div class="col-md-3">
									<input type="text" name="idcard" value="${idcard}" id="selectIdCard"
										placeholder="输入身份证号码" class="form-control" />
								</div>
								 
		
							</div>
							<div class="form-group">
									 	 <label class="control-label col-md-2">所属乡镇：</label>
											<div class="col-md-3">
												 		  <select id="zid" name="zid" class="form-control" onchange="changeZhen(this)">
															<option value="">请选择</option>
															<c:forEach var="xz" items="${xzList}">
																<option value="${xz.id}" <c:if test="${xz.id==zid}">selected="selected"</c:if>>${xz.name}</option>
															</c:forEach>
														</select>
											</div>
										<label class="control-label col-md-2">所属学校(先选择乡镇)：</label>
										<div class="col-md-3">
											 <select id="schid" name="schid" class="form-control">
												<option value="">请选择</option>
												  <c:forEach var="school" items="${schoolListByZid}">
										 		   <option value="${school.schid}" <c:if test="${school.schid==schid}">selected="selected"</c:if>>${school.name}(${school.level})</option>
										 		
										 	      </c:forEach>
											</select> 
										</div>
										<div class="col-md-2  form-group">
											<button class="btn btn-success"  type="submit">查询</button>
										</div>
									</div>
									 
					</form>
							</div><!-- 控制按钮  end-->
							
							
							<div class="panel-body">
								<table class="table table-bordered table-striped table-condensed table-hover">
									<tr class="success">
										<th width="2%" ><input type="checkbox" id="selectAll" onclick="checkAlls(this)" /></th>
										<th  width="2%"  style="text-align: center">序号</th>
										<th width="5%">名称</th>
										<th style="display:none" width="10%">学籍</th>
										<th width="10%">身份证号</th>
										<th width="5%">性别</th>
										<th width="5%">出生日期</th>
										<th width="5%">年份</th>
										<th width="10%">学年</th>
										<th width="10%">学期</th>
										<th width="9%">资助名称</th>
										<th width="5%">资助金额(元)</th>
										<th width="6%">发放日期</th>
										<th width="5%">发放人</th>
									
										<th  width="6%">状态</th>
										<th width="12%">操作</th>
									</tr>
									<!-- 数据绑定 -->
								<c:forEach items="${pageInfo.list}" var="sub" varStatus="vs">
								<tr>
										 <td><input type="checkbox" name="checkId" value="${sub.id}-${sub.status}" /></td>
								 		<td width="4%" style="text-align:center" >${(pageInfo.pageNum-1)*20+vs.count}</td>
										<td style="display:none">${sub.id }</td>
										<td>${sub.name}</td>
										<td style="display:none" width="10%">${sub.stucode}</td>
										<td>${sub.idcard}</td>
										<td>${sub.sex}</td>
										<td>${sub.birthday}</td>
										<td>${sub.year}</td>
										<td>${sub.studyyear}</td>
										<td>${sub.term}</td>
										<td> 
										<c:if test="${fn:length(sub.subname)>5}">
										<span title="${sub.subname}">${fn:substring(sub.subname,0,5)}...</span>	
										</c:if>
										<c:if test="${fn:length(sub.subname)<=5}">
											${sub.subname}
										</c:if>
										</td>
										<td style="display:none">${sub.subname}</td>
										<td>${sub.subamount}</td>
										<td>${sub.providedate}</td>
										<td>${sub.provide}</td>
										<td>
											<c:if test="${sub.status==1}">初稿</c:if>
											<c:if test="${sub.status==2}">镇审核中</c:if>
											<c:if test="${sub.status==3}">县审核中</c:if>
  										</td>
										<td>
											<button type="button" class="btn btn-primary" 
												<c:if test="${sub.status==1}">data-target="#mymodalupdate" data-toggle="modal" onclick="update(this)"</c:if> >
												 <span class="glyphicon glyphicon-edit"></span> 修改</button>
											 <button type="button" class="btn btn-danger" onclick="del(${sub.id},${sub.status})"> 
											 	<span class="glyphicon glyphicon-remove"></span> 删除</button>
										 </td>
									</tr>
									</c:forEach>	
									 
										
									<!-- 	数据绑定 end -->
								</table>
								<!-- 	分页 -->
									<!-- 	分页 -->
						<my:page prePage="${pageInfo.prePage}"
							nextPage="${pageInfo.nextPage}"
							url="${pageContext.request.contextPath}/govsub/list?n=1&x=1"
							totalPage="${pageInfo.pages}" currentPage="${pageInfo.pageNum}" />

							</div>
						</div><!-- 内容面板 end -->
					</div>
			</div><!-- 	内容展示区 end-->
	 
		
		<!-- 弹层组件 添加标签 -->
		<div class="modal fade" id="mymodal">
			<div class="modal-dialog">
				<div class="modal-content">
					<form action="${pageContext.request.contextPath}/govsub/add"  class="form-horizontal">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
							<h4 class="modal-title" id="mylabel">录入政府资助信息</h4>
						</div>
						<div class="modal-body">
							  
							  <!-- 政府-->
							  <div class="form-group">
									<label class="control-label col-md-3">学校：</label>
									<div class="col-md-8">
										<select name="schid" class="form-control">
											<option value="">请选择</option>
										 	<c:forEach var="school" items="${schoolList}">
										 		<option value="${school.schid}">${school.name}</option>
										 	</c:forEach>
										</select> 
									</div>
								</div>
								 
								<div class="form-group">
									<label class="control-label col-md-3">学生名称：</label>
									<div class="col-md-8">
										<input type="text" name="name" placeholder="请输入名称" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">性别：</label>
									<div class="col-md-8">
										<div class="radio">
										  <label>
										    <input type="radio" name="sex"   value="男" >
										    男
										  </label>
										   <label>
										    <input type="radio" name="sex"   value="女" >
										    女
										  </label>
										</div>
									 
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">身份证号：</label>
									<div class="col-md-8">
										<input type="text" name="idcard" placeholder="请输入身份证号" class="form-control"  />
									</div>
								</div>
								  <!-- 政府-->
								<div class="form-group">
									<label class="control-label col-md-3">学籍号：</label>
									<div class="col-md-8">
										<input type="text" name="stucode" placeholder="请输入学籍号" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">出生日期：</label>
									<div class="col-md-8">
										<input type="text" name="birthday" placeholder="请输入出生日期（2009-10-01）" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">年份：</label>
									<div class="col-md-8">
										<input type="text" name="year" placeholder="请输入年份" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">学年：</label>
									<div class="col-md-8">
									<!-- 	<input type="text" name="studyyear" placeholder="请输入学年" class="form-control"  /> -->
										<select name="studyyear" class="form-control">
												<option value="">请选择</option>
												<option value="2019-2020学年">2019-2020学年</option>
												<option value="2020-2021学年">2020-2021学年</option>
												<option value="2021-2022学年">2021-2022学年</option>
												<option value="2022-2023学年">2022-2023学年</option>
												<option value="2023-2024学年">2023-2024学年</option>
											</select> 
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">学期：</label>
									<div class="col-md-8">
										<select id="term" name="term" class="form-control">
													<option value="">请选择</option>
													<option value="2019年秋季学期">2019年秋季学期</option>
													<option value="2020年春季学期">2020年春季学期</option>
													<option value="2020年秋季学期">2020年秋季学期</option>
													<option value="2021年春季学期">2021年春季学期</option>
													<option value="2021年秋季学期">2021年秋季学期</option>
													<option value="2022年春季学期">2022年春季学期</option>
													<option value="2022年秋季学期">2022年秋季学期</option>
													<option value="2023年春季学期">2023年春季学期</option>
												</select>
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">资助名称：</label>
									<div class="col-md-8">
										<input type="text" name="subname" placeholder="请输入资助名称" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">资助金额：</label>
									<div class="col-md-8">
										<input type="text" name="subamount" placeholder="请输入资助金额（元）" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">发放日期：</label>
									<div class="col-md-8">
										<input type="text" name="providedate" placeholder="请输入发放日期（如  2019-10-01）" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">发放人：</label>
									<div class="col-md-8">
										<input type="text" name="provide" placeholder="请输入发放人" class="form-control"  />
									</div>
								</div>
						</div>
						<div class="modal-footer">
							<button class="btn btn-danger" data-dismiss="modal" type="button">关闭</button>
							<button class="btn btn-primary" type="submit">录入</button>
						</div>
					</form>
				</div>
			</div>
		</div><!-- 弹层组件 添加标签 end -->
	 
	 <!-- 弹层组件 添加标签 -->
		<div class="modal fade" id="mymodalupdate">
			<div class="modal-dialog">
				<div class="modal-content">
					<form action="${pageContext.request.contextPath}/govsub/update"  class="form-horizontal">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
							<h4 class="modal-title" id="mylabel">修改政府资助信息</h4>
						</div>
						<div class="modal-body">
							   <input type="hidden" id="id" name="id" value=""/>
							  <!-- 政府-->
							  <div class="form-group">
									<label class="control-label col-md-3">学校：</label>
									<div class="col-md-8">
												 <select name="schid" class="form-control">
											<option value="">请选择</option>
										 	<c:forEach var="school" items="${schoolList}">
										 		<option value="${school.schid}">${school.name}</option>
										 	</c:forEach>
										</select> 
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">学生名称：</label>
									<div class="col-md-8">
										<input type="text" id="name" name="name" placeholder="请输入名称" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">性别：</label>
									<div class="col-md-8">
										<div class="radio">
										  <label>
										    <input type="radio" name="sex"   value="男" >
										    男
										  </label>
										   <label>
										    <input type="radio" name="sex"   value="女" >
										    女
										  </label>
										</div>
									 
									</div>
								</div>
								  	<div class="form-group">
									<label class="control-label col-md-3">身份证号：</label>
									<div class="col-md-8">
										<input type="text" id="idcard" name="idcard" placeholder="请输入身份证号" class="form-control"  />
									</div>
								</div>
								  <!-- 政府-->
								<div class="form-group">
									<label class="control-label col-md-3">学籍号：</label>
									<div class="col-md-8">
										<input type="text" id="stucode" name="stucode" placeholder="请输入学籍号" class="form-control"  />
									</div>
								</div>
							
								<div class="form-group">
									<label class="control-label col-md-3">出生日期：</label>
									<div class="col-md-8">
										<input type="text" id="birthday" name="birthday" placeholder="请输入出生日期（2009-10-01）" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">年份：</label>
									<div class="col-md-8">
										<input type="text" id="year" name="year" placeholder="请输入年份" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">学年：</label>
									<div class="col-md-8">
									<!-- 	<input type="text" id="studyyear" name="studyyear" placeholder="请输入学年" class="form-control"  />
									 -->	<select  id="studyyear" name="studyyear" class="form-control">
												<option value="">请选择</option>
												<option value="2019-2020学年">2019-2020学年</option>
												<option value="2020-2021学年">2020-2021学年</option>
												<option value="2021-2022学年">2021-2022学年</option>
												<option value="2022-2023学年">2022-2023学年</option>
												<option value="2023-2024学年">2023-2024学年</option>
											</select> 
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">学期：</label>
									<div class="col-md-8">
										<select id="term" name="term" class="form-control">
													<option value="">请选择</option>
													<option value="2019年秋季学期">2019年秋季学期</option>
													<option value="2020年春季学期">2020年春季学期</option>
													<option value="2020年秋季学期">2020年秋季学期</option>
													<option value="2021年春季学期">2021年春季学期</option>
													<option value="2021年秋季学期">2021年秋季学期</option>
													<option value="2022年春季学期">2022年春季学期</option>
													<option value="2022年秋季学期">2022年秋季学期</option>
													<option value="2023年春季学期">2023年春季学期</option>
												</select> </div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">资助名称：</label>
									<div class="col-md-8">
										<input type="text" id="subname" name="subname" placeholder="请输入资助名称" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">资助金额：</label>
									<div class="col-md-8">
										<input type="text" id="subamount" name="subamount" placeholder="请输入资助金额（元）" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">发放日期：</label>
									<div class="col-md-8">
										<input type="text" id="providedate" name="providedate" placeholder="请输入发放日期（如  2019-10-01）" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">发放人：</label>
									<div class="col-md-8">
										<input type="text" id="provide" name="provide" placeholder="请输入发放人" class="form-control"  />
									</div>
								</div>
						</div>
						<div class="modal-footer">
							<button class="btn btn-danger" data-dismiss="modal" type="button">关闭</button>
							<button class="btn btn-primary" type="submit">修改</button>
						</div>
					</form>
				</div>
			</div>
		</div><!-- 弹层组件 添加标签 end -->
	 
	 	
		<div class="modal fade" id="mymodalimport">
			<div class="modal-dialog">
				<div class="modal-content">
					<form action="${pageContext.request.contextPath}/govsub/importBetch"
					method="post" enctype="multipart/form-data"  class="form-horizontal">
						<div class="modal-header">  
							<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
							<h4 class="modal-title" id="mylabel">导入政府资助学生信息</h4>
 						</div>
						<div class="modal-body">
							   
							  <!-- 政府-->
								<div class="form-group">
									<label class="control-label col-md-3">选择导入的文件（excel格式）：</label>
									<div class="col-md-8">
									    <input type="file"  name="file" class="form-control"  />
									</div>
								</div>
								  <!-- 政府-->
							 
						</div>
						<div class="modal-footer">
							<button class="btn btn-danger" data-dismiss="modal" type="button">关闭</button>
							<button class="btn btn-primary" type="submit" >导入</button>
						</div>
					</form>
				</div>
			</div>
		</div><!-- 弹层组件 添加标签 end -->
		
	</body>
</html>
<script>

function changeZhen(obj){
	 //ajax   根据镇id 查询 它学校表中的 数据 
	if(obj.value!=''){
		  $.ajax({
				url : '../school/getSchoolByZid?zid='+obj.value,
				type : "get",
				dataType : "json",
				success : function(data) {
					 
					if(data!=null){
						$("#schid option:gt(0)").remove();
						for(var i=0;i<data.length;i++){
							var opt = "<option value='"+data[i].schid+"'>"+data[i].name+"("+data[i].level+")</optoin>";
							$("#schid").append(opt);
						}
					} 
				},
				error : function(xhr) {
					 
				}
			});
	}else{
		$("#schid option:gt(0)").remove();
	}
}


	 $(function () {
	  
        $('form:gt(0)').bootstrapValidator({
　　　　　　　　message: 'This value is not valid',
            　feedbackIcons: {
                　　　　　　　　valid: 'glyphicon glyphicon-ok',
                　　　　　　　　invalid: 'glyphicon glyphicon-remove',
                　　　　　　　　validating: 'glyphicon glyphicon-refresh'
            　　　　　　　　   },
              fields: {
                name: {
                    message: '用户名验证失败',
                    validators: {
                        notEmpty: {
                            message: '姓名不能为空'
                        }
                    }
                },
                stucode: {
                    validators: {
                        notEmpty: {
                            message: '学籍号不能为空'
                        }
                    }
                },
                schid: {
                    validators: {
                        notEmpty: {
                            message: '学校不能为空'
                        }
                    }
                },
                idcard: {
                    validators: {
                        notEmpty: {
                            message: '身份证号不能为空'
                        },
                        stringLength: {
                            min: 18,
                            max: 18,
                            message: '身份证号长度必须是18位'
                        }
                    }
                },
                sex: {
                    validators: {
                        notEmpty: {
                            message: '性别不能为空'
                        }
                    }
                }  ,
                birthday: {
                    validators: {
                        notEmpty: {
                            message: '出生日期不能为空'
                        }
                    }
                }  ,
                year: {
                    validators: {
                        notEmpty: {
                            message: '年份不能为空'
                        }
                    }
                }  , 
                studyyear: {
                    validators: {
                        notEmpty: {
                            message: '学年不能为空'
                        }
                    }
                }  , 
                term: {
                    validators: {
                        notEmpty: {
                            message: '学期不能为空'
                        }
                    }
                }  ,
                subname: {
                    validators: {
                        notEmpty: {
                            message: '资助名称不能为空'
                        }
                    }
                } 
                ,
                subamount: {
                    validators: {
                        notEmpty: {
                            message: '资助金额不能为空'
                        }
                    }
                } ,
                providedate: {
                    validators: {
                        notEmpty: {
                            message: '发放日期不能为空'
                        }
                    }
                },
                provide: {
                    validators: {
                        notEmpty: {
                            message: '发放人不能为空'
                        }
                    }
                }
            } ,
            submitHandler: function (validator, form, submitButton) {
              // alert("submit");
            }
        });
    });
	 
	 function del(id,status){
		 
			  if(status!=1){
				alert("该学生已审批，不能删除");
				return;
			}
		  	var flag =  confirm("确认是否删除？");
		  	if(flag){
		  		var path  ='${pageContext.request.contextPath}';
		  		//alert(id);
		  		location.href= path+"/govsub/delete?id="+id;
		  	} 
		}
	   
     function update(obj){/*点击修改按钮，给模态框加载信息并且弹出模态框*/
         var tds= $(obj).parent().parent().find('td');
          $("#id").val(tds.eq(2).text());
  		  $("#name").val(tds.eq(3).text());
  		  $("#stucode").val(tds.eq(4).text());
  		  $("#idcard").val(tds.eq(5).text());
  		  $("#sex").val(tds.eq(6).text());
  		  $("#birthday").val(tds.eq(7).text());
  		  $("#year").val(tds.eq(8).text());
  		// $("#studyyear").val(tds.eq(7).text());
  		 $("#term").val(tds.eq(10).text());
  		 $("#subname").val(tds.eq(12).text());
  		 $("#subamount").val(tds.eq(13).text());
  		 $("#providedate").val(tds.eq(14).text());
  		 $("#provide").val(tds.eq(15).text());
		  
  	   }
     
     function downTemplate(){
  	   location.href="downTemplate";
     }
     
     //批量删除 
	  function removeAll(){
   	  var msg="";
		 var ids="";
			var checkId= document.getElementsByName("checkId");
			 for(var i=0;i<checkId.length;i++){
				 if(checkId[i].checked==true){
					 //获取id  和 状态  ，只有状态为1 可以删除
					  var s =checkId[i].value;
					 var id = s.substring(0,s.indexOf("-"));
					 var status = s.substring(s.indexOf("-")+1);
					 if(status!="1"){
						// alert("只能删除草稿状态的学生。 ");
						// return;   获取序号
						msg+="["+$(checkId[i]).parent().next().text()+"]";
					 }
					 ids+=id+",";
				 }
			 }
			 
			 //验证所有的状态是否为草稿 
			 if(msg!=""){
				 alert("只能删除初稿状态的学生， 序号 "+msg+"的数据不能删除。 ");
				 return;
			 }
			 
		    ids=ids.substring(0,ids.length-1);
		    var flag =  confirm("确认是否批量删除，请再次核实数据？");
		  	   if(flag){
		  		   var path  ='${pageContext.request.contextPath}';
		  		   //alert(id);
		  		    location.href= path+"/govsub/deleteBatch?ids="+ids;
		  	   }
	  }
	 
	 function checkAlls(obj){
		 var c = obj.checked;
		var checkId= document.getElementsByName("checkId");
		 for(var i=0;i<checkId.length;i++){
			 
			 checkId[i].checked=c;
		 }
		 
	 }

	 $(function(){
		 var flag  ='${successFlag}';
		 if(flag=='true'){
			 alert('操作成功！ ');
		 }
			 
	 });
</script>